package wfmanage.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import edu.wfmanage.models.Claim;
import edu.wfmanage.models.User;
/**
 	Author: Satya Deepthi Bhagi
 */
public class financeQueue extends ActionSupport {

	
	private static final long serialVersionUID = 1L;
	private List<Claim> financeitems;
	private int ApprovedAmount;
	private int LTALimit;
	public String execute() throws Exception {
		Map<String, Object> session = ActionContext.getContext().getSession();
		User user = (User) session.get("user");
		if (user == null) {
			user = new User();
		}
		financeitems=new ArrayList<Claim>();
		LTALimit=Claim.getLTALimit("select LTA_Limit from employee where user_id= '" + user.getUserid()+"'");
		financeitems = Claim.findfinanceitems("select * from request where VERIFY_DPT_STATUS ='VerificationPassed'and FINANCE_DPT_STATUS='finance approval pending'and status='pending'",LTALimit);
		return "success";
	}
	
	public int getLTALimit() {
		return LTALimit;
	}

	public void setLTALimit(int lTALimit) {
		LTALimit = lTALimit;
	}

	public List<Claim> getFinanceitems() {
		return financeitems;
	}
	public void setFinanceitems(List<Claim> financeitems) {
		this.financeitems = financeitems;
	}
	public int getApprovedAmount() {
		return ApprovedAmount;
	}
	public void setApprovedAmount(int approvedAmount) {
		ApprovedAmount = approvedAmount;
	}
	
}
